import 'package:calculator/pub/ScreenAdapter.dart';
import 'package:flutter/material.dart';

class MyDialog extends StatefulWidget {
  String url = '';
  MyDialog({Key key, @required this.url}) : super(key: key);

  @override
  _MyDialogState createState() => _MyDialogState();
}

class _MyDialogState extends State<MyDialog> {
  @override
  Widget build(BuildContext context) {
    ScreenAdapter.init(context);
    return Material(
      type: MaterialType.transparency, //透明类型
      child: Container(
          // alignment: Alignment.center,
          // height: ScreenAdapter.height(800),
          padding: EdgeInsets.fromLTRB(ScreenAdapter.width(100), 0, ScreenAdapter.width(100), 0),
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: <Widget>[
              GestureDetector(
                onTap: () async{
                  Navigator.pushNamed(context, '/h5/view', arguments: {
                    'url' : '${widget.url}',
                  });
                },
                child: Image.asset('images/dialog.png'),
              ),
              SizedBox(height: ScreenAdapter.height(120),),
              GestureDetector(
                onTap: (){
                  Navigator.pop(context);
                },
                child: Image.asset('images/close.png'),
              ),
            ],
          )
        ),
    );
  }
}